package com.example.day01.model;

import com.example.day01.Api;
import com.example.day01.contract.LoginContract;
import com.example.net.RetrofitFactory;

import java.util.HashMap;

import io.reactivex.Observable;

public class LoginModel implements LoginContract.LoginModel {
    @Override
    public Observable requestRegister(HashMap<String, String> map) {
        Api api = RetrofitFactory.getInstance("https://www.wanandroid.com/user/").create(Api.class);
        return api.register(map);
    }

    @Override
    public Observable requestLogin(HashMap<String, String> map) {
        Api api = RetrofitFactory.getInstance("https://www.wanandroid.com/user/").create(Api.class);
        return api.login(map);
    }

    @Override
    public Observable requestXia(HashMap<String, String> map) {

        Api api = RetrofitFactory.getInstance("http://www.qubaobei.com/").create(Api.class);
        return api.XiaData(map);
    }

    @Override
    public void destory() {

    }
}
